home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: How to dynamically allocate first element of linked list.
- Date: 11 Jan 1996 15:45:37 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Jan11084537@qcd.lanl.gov>
- References: <erkDL007G.rt@netcom.com>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: erk@netcom.com's message of Thu, 11 Jan 1996 00:48:04 GMT
-
- --text follows this line--
- In article <erkDL007G.rt@netcom.com> erk@netcom.com (Staugher) writes:
- <snip>
- struct elmnt * newlist(void)
- {
- struct elmnt *newptr;
- newptr = malloc(sizeof(struct elmnt));
- return (newptr);
- }
-
- //=======================================
-
-
- The compiler complains with an ERROR that it cannot convert
- (void *) to (elmnt *) in function newlist
-
- First off, you don't show it, but you probably _have_ included
- <stdlib.h>. Please post complete compilable code, NOT fragments.
-
- Second, // does NOT introduce a comment in C. It does in C++.
-
- Third, the error message is likely to have come from a C++ compiler:
- not a C compiler.
-
- I hope that the problem is obvious to someone :/
-
- If you want to compile a C program, use a C compiler. If you have
- problems with C++, post in an appropriate newsgroup. C and C++ are not
- the same compiler, though small computer (PC/Mac) users often seem to
- forget that.
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-